<html>
<head>
    <title>jQuery Refresh Demo</title>
    <style>
body { font-size: 11pt; }
.top { font-size: 1.2em; }
.box {
    margin: 0px 5px;
    padding: 5px;
    border: 1px dotted black;
}
#el {
    clear: both;
    height: 100;
    width: 100;
    background-color: yellow;
}
    </style>
    <script type="text/javascript" src="../../jquery.1.3.2.js"></script>
    <script type="text/javascript" src="jquery.refresh.js"></script>
    <script type="text/javascript" src="../rest/jquery.rest.js"></script>
    <script type="text/javascript">
    // you can set a page refresh before dom ready
    $.refresh('test.json', 5*1000, function(data) {
        var $span = $('#page');
        $span.text(parseFloat($span.text(),10) + data.value);
    });
    // on dom ready
    $(function() {
        var r = $('#el').refresh('test.json', 3*1000, function(data) {
            var $span = $(r.target).find('span');
            $span.text(parseFloat($span.text(),10) + data.value);
        });
    });
    </script>
    <script type="text/javascript" src="../log/log.js"></script>
</head>
<body>
<div class="top box">
  Here's a demo with unrealistically short refresh times.
  View the source code to see how it works.
</div>
<br clear="all">
<div class="box main">
   The page has been refreshed <span id="page">0</span> times.
   <div id="el">This box has been refreshed <span>0</span> times.</div>
</div>
</body>
</html>